<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<div class="middle">
	<form action="<?php echo site_url('settings/config'); ?>" method="post" name="frmConfig" id="frmConfig">
		<div class="pad10">
	        <p>
	            <a href="<?php echo site_url('settings/view'); ?>">
	                <b><?php echo $settings_lang['module_title']; ?></b>
	            </a>
	            -&gt;
	            <?php echo $settings_lang['setting_config']; ?>
	           
	        </p>
	        
	        <div class="padtop10">
	            
	            <?php
	            if($mess != '')
	            {
	            ?>
	                <p class="pad10 text-center"><?php echo $mess; ?></p>
	            <?php
	            }
	            ?>
        
            
                
                <table width="100%">
					<tr>
						<td class="pad5 bold" width="200">
							<?php echo $settings_lang['config_cpc_price']; ?> (<?php echo $settings_lang['vnd']; ?>)
						</td>
						
						<td class="pad5">
							<input type="text" id="cprice" name="cprice" value="<?php echo $config['CPCPrice']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_cpm_price']; ?> (<?php echo $settings_lang['vnd']; ?>)
						</td>
						
						<td class="pad5">
							<input type="text" id="cpm_price" name="cpm_price" value="<?php echo $config['CPMPrice']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold">
							<?php echo $settings_lang['config_serving_email']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="serving_email" name="serving_email" value="<?php echo $config['serving_email']; ?>" size="100" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_serving_email_name']; ?>
						</td>
						
						<td class="pad5">
							<textarea id="serving_email_name" name="serving_email_name" cols="100" rows="10"><?php echo $config['serving_email_name']; ?></textarea>
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_max_title']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="max_title" name="max_title" value="<?php echo $config['max_title']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_max_body_text']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="max_body_text" name="max_body_text" value="<?php echo $config['max_body_text']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_image_w']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="image_w" name="image_w" value="<?php echo $config['image_w']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_image_h']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="image_h" name="image_h" value="<?php echo $config['image_h']; ?>" />
						</td>
					</tr>

					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_admin_email']; ?>
						</td>
						
						<td class="pad5">
							<textarea id="admin_email" name="admin_email" cols="100" rows="20"><?php echo $config['admin_email']; ?></textarea>
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['config_publisher_email']; ?>
						</td>
						
						<td class="pad5">
							<textarea id="publisher_email" name="publisher_email" cols="100" rows="20"><?php echo $config['publisher_email']; ?></textarea>
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['money_unit_value']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="money_unit_value" name="money_unit_value" value="<?php echo $config['money_unit_value']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['max_title_set_style']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="max_title_set_style" name="max_title_set_style" value="<?php echo $config['max_title_set_style']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							<?php echo $settings_lang['max_body_set_style']; ?>
						</td>
						
						<td class="pad5">
							<input type="text" id="max_body_set_style" name="max_body_set_style" value="<?php echo $config['max_body_set_style']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							Show custom error
						</td>
						
						<td class="pad5">
							<input type="text" id="show_custom_error" name="show_custom_error" value="<?php echo $config['show_custom_error']; ?>" />
						</td>
					</tr>
					
					<tr>
						<td class="pad5 bold" >
							&nbsp;
						</td>
						
						<td class="pad5">
							<input type="button" class="bold" value="  Submit  " onclick="tmpConfigSubmit();" />
                
                			<input type="button" class="bold" value="  Reload  " onclick="tmpConfigReload();" />
						</td>
					</tr>
					
					
				</table>
            
        	</div>
        
    	</div>
	</form>
</div>

<script type="text/javascript">
    function tmpConfigSubmit()
    {
        if(confirm('Are you sure?'))
        {
            $('#frmConfig').submit();
        }
    }
    
    function tmpConfigReload()
    {
        window.location = '<?php echo site_url('settings/config'); ?>';
    }
</script>